package http

import (
	"gddgame.cc/galaxy/utils/def"
	"gddgame.cc/galaxy/utils/request"
)

var (
	reqPool *request.Pool
)

func init() {
	reqPool = request.NewPool(nil)
}

func Post(context def.Context, url string) *request.SuperAgent {
	req := reqPool.New()
	return req.Post(url).SetLogger(context).AppendHeader("trackId", context.ID())
}

func Get(context def.Context, url string) *request.SuperAgent {
	req := reqPool.New()
	return req.Get(url).SetLogger(context).AppendHeader("trackId", context.ID())
}
